package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.InsectsMapper;
import com.youlai.boot.system.mapper.InspectionMapper;
import com.youlai.boot.system.model.QB.Inspection;
import com.youlai.boot.system.service.InspectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class InspectionServiceImpl extends ServiceImpl<InspectionMapper, Inspection> implements InspectionService{
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private InspectionMapper inspectionMapper;
    @Override
    public boolean saveInspection(Inspection inspection) {

        inspection.setAddtime(LocalDateTime.now());
        return save(inspection);
    }

    @Override
    public List<Inspection> getAllInspection() {
        return inspectionMapper.selectList(null);
    }

    @Override
    public boolean deleteInspectionById(Integer id) {
        return inspectionMapper.deleteById(id) > 0;
    }
}
